package edu.hz.dao;


import edu.hz.model.entity.DonationEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DonationMapper {

    @Insert("INSERT INTO donations (name, start, end, need_money, current_money, author, profile, content, is_top) " +
            "VALUES (#{name}, #{start}, #{end}, #{needMoney}, 0, #{author}, #{profile}, #{content}, #{isTop})")
    int insertDonation(DonationEntity dto);

    @Select("select * from donations")
    List<DonationEntity> allDonations();

}
